package OtherTest.Lambda;

public class LambdaExpressDemo {
    public static void main(String[] args) {

//        Foo foo = () -> System.out.println("111");
//        foo.sayHello();

        Foo foo1 = new Foo() {
            @Override
            public String sayAny(String str) {
                return "111";
            }
        };

        Foo foo2 = str -> {
            System.out.println(str);
            return "带上返回值的" + str;
        };

        // Foo foo3 = System.out::println;

        Foo foo4 = str -> {
            str = str.replace('1', '2');
            System.out.println(str);
            return "111";
        };

        Foo foo5 = SaySth::sysSth;

        Foo foo6 = SaySth::sysSthSth;


        System.out.println(foo5.sayAny("啊"));
        System.out.println(foo6.sayAny("哦"));

        // foo2.sayAny("1");

    }
}
